package front_message_api

import (
	"blog_go/models"
	"blog_go/models/res"
	"blog_go/service/common"
	"github.com/gin-gonic/gin"
	"github.com/sirupsen/logrus"
)

func (MessageApi) MessageListAll(c *gin.Context) {
	page := models.DefaultPageInfo()
	if err := c.ShouldBindQuery(page); err != nil {
		logrus.Error(err)
		panic(err)
	}
	list, count, err := common.ComList(models.MessageModel{}, page)
	if err != nil {
		logrus.Error(err)
		panic(err)
	}
	res.OkWithList(list, count, c)
}
